﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DCS.DataProvider;
using DCS.Business.Model;

namespace DCS.Business.Manager
{
    public class PFSMessageManager
    {
        private IDataProvider provider;
        static log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public PFSMessageManager(IDataProvider p)
        {
            this.provider = p;
        }

        public void SaveEntities(List<PFSMessage> results)
        {
            foreach (var item in results)
            {
                try
                {
                    provider.CreatePFSMessage(item);
                }
                catch (Exception e)
                {
                    Logger.Error(e);
                }
            }
        }
    }
}
